<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            var findMaxForm = function (strs, m, n) {
                let dp = new Array(m + 1).fill().map(() => new Array(n + 1).fill(0))
                for (let str of strs) {
                    let zeroNum = 0
                    let oneNum = 0
                    for (let s of str) {
                        if (s == '0') {
                            zeroNum++
                        } else {
                            oneNum++
                        }
                    }
                    for (let i = m; i >= zeroNum; i--) {
                        for (let j = n; j >= oneNum; j--) {
                            dp[i][j] = Math.max(dp[i][j], dp[i - zeroNum][j - oneNum] + 1)
                        }
                    }
                }
                return dp[m][n]
            }
        </script>
    </body>
</html>
